package cn.shutdown.redis;

import org.springframework.context.support.ClassPathXmlApplicationContext;
import redis.clients.jedis.JedisCluster;

/**
 * 通过Factory创建JedisCluster
 * @author jiangwujie
 * @date 2021/11/8
 */
public class JedisDemo3 {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(
                "classpath:applicationContext2.xml");
        JedisCluster jc = (JedisCluster) context.getBean("jedisCluster");
        jc.set("foo", "bar");
        String value = jc.get("foo");
        System.out.println("value:" + value);
    }
}
